<html>
<head><meta charset="utf-8"><title>New directives in debuginfo test cases · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/New.20directives.20in.20debuginfo.20test.20cases.html">New directives in debuginfo test cases</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="236285090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/New%20directives%20in%20debuginfo%20test%20cases/near/236285090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lrh2000 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/New.20directives.20in.20debuginfo.20test.20cases.html#236285090">(Apr 27 2021 at 05:22)</a>:</h4>
<p>Hi all. I'm dealing with <a href="https://github.com/rust-lang/rust/issues/79009">#79009</a>, as I have already described in <a href="https://github.com/rust-lang/rust/issues/79009#issuecomment-826952708">https://github.com/rust-lang/rust/issues/79009#issuecomment-826952708</a>.</p>
<p>An important problem is that different versions of GDB can have different behaviors. Older GDB treats generators as structs and newer GDB treats generators as enums (the latter is consistent with rustc). So we may need something like</p>
<div class="codehilite"><pre><span></span><code> // max-gdb-version 9.2
</code></pre></div>
<p>or</p>
<div class="codehilite"><pre><span></span><code> // define-gdb-prefix old 8.0 ..= 9.2
 // define-gdb-prefix new 9.2 ..= 10.2
</code></pre></div>
<p>or even this</p>
<div class="codehilite"><pre><span></span><code> // define-gdb-prefix old ..= 9.2
 // define-gdb-prefix new 9.2 ..
</code></pre></div>
<p>which means we use <code>gdb-old</code> if the version of GDB is less than or equal to 9.2 and we use <code>gdb-new</code> otherwise (i.e. if the version of GDB is greater than 9.2).<br>
Therefore, it enables us to write</p>
<div class="codehilite"><pre><span></span><code> // gdb-command:print b
 // gdb-old-check:$1 = generator_objects::main::generator-0 {__0: 0x[...], &lt;&lt;variant&gt;&gt;: {[...]}}
 // gdb-new-check:$1 = generator_objects::main::generator-0::Suspend0{c: 6, d: 7}
</code></pre></div>
<p>I think it is useful. Currently it seems that we only have <code>min-gdb-version</code> and <code>ignore-gdb-version</code> and they are not enough.</p>
<p>Does this make sense?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>